/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg23designpatterns.za.ac.cput.selectedPatterns;

import java.util.Date;

public class Singleton 
{
    private static Singleton theOnlyOne;
    private Date d = new Date();
    
    
    private Singleton ()
    {
    
    }
    
    public synchronized static Singleton instance()
    {
        if (theOnlyOne == null)
        {
            theOnlyOne = new Singleton();
        }
        return theOnlyOne;        
    }
    
    public Date getDate()
    {
        return d;
    }
}